{yun:}include file="$comstyle/header.htm"{/yun} 
<div class="w1000">
	<div class="admin_mainbody"> {yun:}include file="$comstyle/left.htm"{/yun}
   <div class="com_tit"><span class="com_tit_span">新增兼职</span></div> <div class=right_box>
		<div class=admincont_box>
			
			<div class="com_body">
            <div class="com_new_tip"> 
          <span class="com_new_tip_h">温馨小提示</span>贵公司还可以发布（<span class="f60">{yun:}if $statis.vip_etime>$todayEnd || $statis.vip_etime=="0"{/yun}{yun:}if $statis.rating_type==1{/yun}{yun:}$statis.job_num{/yun}{yun:}else{/yun}不限{yun:}/if{/yun}{yun:}else{/yun}0{yun:}/if{/yun}</span>）条兼职信息{yun:}if $statis.vip_etime < time() && $statis.vip_etime != 0{/yun}
								您的会员已到期，为了更好的招聘人才，请先<a href="index.php?c=right" class="cblue"> 升级会员</a>！
							{yun:}/if{/yun} 
                            </div>
     
			
				<div class="com_release_box">
				<iframe id="supportiframe"  name="supportiframe" onload="returnmessage('supportiframe');" style="display:none"></iframe>
            <form name="MyForm" target="supportiframe" method="post" action="index.php?c=partadd&act=save" onsubmit="return CheckPost_part();" class="layui-form">
              <input type="hidden" id="cionly" name="cionly" value="{yun:}if empty($city_type){/yun}1{yun:}/if{/yun}">
              
              <ul>
                <li>
                  <div class="com_release_name"><i class="ff0">*</i> 兼职名称</div>
                  <div class="com_release_cont_text">
                    <input type="text" placeholder="兼职名称" size="45" id='name' name="name" value="{yun:}$row.name{/yun}" class="layui-input" >
                  </div>
                </li>
                <li>
                  <div class="com_release_name"><i class="ff0">*</i> 兼职类型</div>
                  <div class="com_release_cont">
                    <div class="com_release_selectbox">
                  <div class="layui-input-inline">
                    <select name="type" lay-filter="type" id="type">
                    <option value=''>请选择</option>
                    {yun:}foreach from=$partdata.part_type key=j item=v{/yun}<option value="{yun:}$v{/yun}" {yun:}if $row.type == $v{/yun} selected{yun:}/if{/yun}>{yun:}$partclass_name[$v]{/yun}</option>{yun:}/foreach{/yun}</select>
                  </div>
                  </div>
                </li>
                <li>
                  <div class="com_release_name"><i class="ff0">*</i> 招聘人数 </div>
                  <div class="com_release_cont">
                    <div class="layui-input-inline inline">
                      <input type="text" size="10" name="number" id="number" value="{yun:}$row.number{/yun}" onkeyup="this.value=this.value.replace(/[^0-9]/g,'')" placeholder="招聘人数" class="layui-input">
                    </div>
                    <div class="inline">人</div>
                  </div>
                </li>
                <li>
                  <div class="com_release_name"><i class="ff0">*</i> 兼职时间</div>
                  <div class="com_release_cont">
                    <table class="tjob_timetable" cellpadding="0" cellspacing="1" >
                      <tr>
                        <th>&nbsp;</th>
                        <th>周一</th>
                        <th>周二</th>
                        <th>周三</th>
                        <th>周四</th>
                        <th>周五</th>
                        <th>周六</th>
                        <th>周日</th>
                      </tr>
                      <tr>
                        <th>上午</th>
                        {yun:}foreach from=$part_morning item=v{/yun}
                        <td><input data-mark='isneed' name='worktime[]' class="check_all" id='worktime{yun:}$v{/yun}' type="checkbox" lay-filter="partAll" {yun:}if in_array($v,$row.worktime_n){/yun}checked="checked"{yun:}/if{/yun}value='{yun:}$v{/yun}' lay-skin="primary" /></td>
                        {yun:}/foreach{/yun} </tr>
                      <tr>
                        <th>下午</th>
                        {yun:}foreach from=$part_noon item=v{/yun}
                        <td><input data-mark='isneed' name='worktime[]' class="check_all" id='worktime{yun:}$v{/yun}' type="checkbox" lay-filter="partAll" {yun:}if in_array($v,$row.worktime_n){/yun}checked="checked"{yun:}/if{/yun} value='{yun:}$v{/yun}' lay-skin="primary" /></td>
                        {yun:}/foreach{/yun} </tr>
                      <tr>
                        <th>晚上</th>
                        {yun:}foreach from=$part_afternoon item=v{/yun}
                        <td><input data-mark='isneed' name='worktime[]' class="check_all" id='worktime{yun:}$v{/yun}' type="checkbox" lay-filter="partAll" {yun:}if in_array($v,$row.worktime_n){/yun}checked="checked"{yun:}/if{/yun} value='{yun:}$v{/yun}' lay-skin="primary" /></td>
                        {yun:}/foreach{/yun} </tr>
                      <tr>
                        <td colspan="8"><input id='ckAll' name='ckAll' value="1" type="checkbox" lay-filter="ckAll"  lay-skin="primary">
                          全选</td>
                      </tr>
                    </table>
                    <span class="com_Release_job_qx"> </span> </div>
                </li>
                <li>
                  <div class="com_release_name"><i class="ff0">*</i> 兼职有效期</div>
                  <div class="com_release_cont">
                    <input id="sdate" class="input-text com_info_text com_info_text_time com_info_textw158 item_date" type="text" readonly="" size="15" value="{yun:}if $row.sdate{/yun}{yun:}$row.sdate|date_format:'%Y-%m-%d'{/yun}{yun:}/if{/yun}" name="sdate" placeholder="兼职开始日期"/>
                    <span class="part_zhi">到</span>
                    
					<input id="edate" class="input-text com_info_text com_info_text_time com_info_textw158 item_date" type="text" readonly="" size="15" value="{yun:}if $row.edate{/yun}{yun:}$row.edate|date_format:'%Y-%m-%d'{/yun}{yun:}/if{/yun}" name="edate" placeholder="兼职结束日期" {yun:}if $row.edate==0{/yun}style="display:none"{yun:}/if{/yun}/>

                    <input type="checkbox" value='1' id="timetype" name="timetype" class="input-text" {yun:}if $row.edate==0{/yun}checked="checked"{yun:}/if{/yun} onclick="change()" lay-filter="timetype" title="长期招聘" lay-skin="primary"/>
                  </div>
                  <span id="by_edate" class="errordisplay">截止日期要大于当前日期</span> </li>
                
                <li>
                  <div class="com_release_name"><i class="ff0">*</i> 薪资水平：</div>
                  <div class="com_release_cont">
                   <input type="text" size="25" name="salary" id="salary" value="{yun:}$row.salary{/yun}" onkeyup="this.value=this.value.replace(/[^0-9]/g,'')" style="float:left" class="com_info_text com_info_text_w103 " placeholder="薪资水平">
                   <div style="display:inline-block;width:100px;">
                      <div class="layui-input-inline">
                        <select name="salary_type" id="salary_type" lay-filter="salary_type">
						{yun:}foreach from=$partdata.part_salary_type key=j item=v{/yun}
						<option value="{yun:}$v{/yun}" {yun:}if $row.salary_type == $v{/yun} selected{yun:}/if{/yun}>{yun:}$partclass_name[$v]{/yun}</option>{yun:}/foreach{/yun}
						</select>
                      </div>
                      </div>
                  </div>
                </li>
                <li class="job_add_bc">
                  <div class="com_release_name"><i class="ff0">*</i> 薪资结算：</div>
           
                    <div class="com_release_selectbox">
                 <div class="layui-input-inline">
                        <select name="billing_cycle" id="billing_cycle" lay-filter="billing_cycle">{yun:}foreach from=$partdata.part_billing_cycle key=j item=v{/yun}<option value="{yun:}$v{/yun}" {yun:}if $row.billing_cycle == $v{/yun} selected{yun:}/if{/yun}>{yun:}$partclass_name[$v]{/yun}</option>{yun:}/foreach{/yun}</select>
                      </div>
                    </div>
                </li>
                <li>
                  <div class="com_release_name"><i class="ff0">*</i> 兼职内容：</div>
                  <div class=textbox>
 					<script id="content" name="content" type="text/plain" style="width:600px; height:200px;"> {yun:}$row.content{/yun} </script>
                  </div>
                </li>
                <li class="job_add_bc">
                  <div class="com_release_name">性别要求：</div>
                  <div class="com_release_cont">
                  
                      <div class="layui-input-inline">
                        <select name="sex" lay-filter="sex" id="sex">{yun:}foreach from=$part_sex key=j item=v{/yun}<option value="{yun:}$j{/yun}" {yun:}if $row.sex == $j{/yun} selected{yun:}/if{/yun}>{yun:}$part_sex[$j]{/yun}</option>{yun:}/foreach{/yun}
                  </select>
                      </div>
                  
                    <span id="by_ltsexid" class="errordisplay">请选择性别</span> </div>
                </li>
                <li>
                  <div class="com_release_name"><i class="ff0">*</i> 工作地点：</div>
                  <div class="com_release_cont">
                   <div class="layui-input-inline">
                        <select name="provinceid" id="provinceid" lay-filter="citys">
                          <option value="">请选择</option>{yun:}foreach from=$city_index key=j item=v{/yun}<option value="{yun:}$v{/yun}" {yun:}if $row.provinceid == $v{/yun} selected{yun:}/if{/yun}>{yun:}$city_name[$v]{/yun}</option>{yun:}/foreach{/yun}</select>
                      </div>
                      <div class="layui-input-inline">
                        <select name="cityid" lay-filter="citys" id="cityid"><option value="">请选择</option>{yun:}foreach from=$city_type[$row.provinceid] key=j item=v{/yun}<option value="{yun:}$v{/yun}" {yun:}if $row.cityid==$v{/yun} selected{yun:}/if{/yun}>{yun:}$city_name[$v]{/yun} </option>{yun:}/foreach{/yun} </select></div>
                      <div class="layui-input-inline">
                     <select name="three_cityid" lay-filter="three_cityid" id="three_cityid"><option value="">请选择</option>{yun:}foreach from=$city_type[$row.cityid] key=j item=v{/yun}<option value="{yun:}$v{/yun}" {yun:}if $row.three_cityid==$v{/yun} selected{yun:}/if{/yun}>{yun:}$city_name[$v]{/yun} </option>{yun:}/foreach{/yun}</select>
                      </div>
                  </div>
                </li>
                <li>
                  <div class="com_release_name"><i class="ff0">*</i> 详细地址：</div>
                  <div class="com_release_cont">
                    <input type="text" size="45" id='address' name="address" value="{yun:}$row.address{/yun}" class="com_info_text" onblur="localsearch('全国');" style="width:400px;" placeholder="详细地址">
                  </div>
                  <div class="clear"></div>
                  <script src="{yun:}$config.mapurl{/yun}"></script> 
                  <script type="text/javascript" src="{yun:}$config.sy_weburl{/yun}/js/map.js?v={yun:}$config.cachecode{/yun}"></script>
                  <div id="map_container" style="width:70%;height:300px; left:0px;"></div>
                  <input name="x" id="map_x" type="hidden" value="{yun:}$row.x{/yun}">
                  <input name="y" id="map_y" type="hidden" value="{yun:}$row.y{/yun}">
                </li>
                <li>
                  <div class="com_release_name"><i class="ff0">*</i> 联系人：</div>
                  <div class="com_release_cont">
                    <input type="text" placeholder="联系人" size="45" id='linkman' name="linkman" value="{yun:}if $row.linkman{/yun}{yun:}$row.linkman{/yun}{yun:}else{/yun}{yun:}$company.linkman{/yun}{yun:}/if{/yun}" class="com_info_text" maxlength="12">
                  </div>
                </li>
                <li>
                  <div class="com_release_name"><i class="ff0">*</i> 联系手机：</div>
                  <div class="com_release_cont">
                    <input type="text" size="45" id='linktel' name="linktel" value="{yun:}if $row.linktel{/yun}{yun:}$row.linktel{/yun}{yun:}else{/yun}{yun:}$company.linktel{/yun}{yun:}/if{/yun}" onkeyup="this.value=this.value.replace(/[^0-9-]/g,'')" class="com_info_text" maxlength="12" placeholder="联系手机">
                  </div>
                </li>
                <li> 
                <input name="logid" id="logid" type="hidden"/>
                <input name="r_status" id="r_status" type="hidden" value="{yun:}$company.r_status{/yun}"/>
                <input name="id" id="id" value="{yun:}$smarty.get.id{/yun}" type="hidden"/>
                <input class="btn_01" type="submit" name="submit" value=" 提 交 操 作 "></li>
                
              </ul>
           
            </form>
          </div>
        </div>
        <br>
        </div>
    </div>
  </div>
</div>

<script>
var map=new BMap.Map("map_container");
setLocation('map_container',116.404,39.915,"map_x","map_y");
	$(document).ready(function() {
		{yun:}if ($row.x=="" || $row.y=="") && $row.address!=""{/yun}
			$("#address").val("{yun:}$row.address{/yun}");
			var address="{yun:}$row.address{/yun}";
			localsearch('{yun:}$city_name[$row.provinceid]{/yun}{yun:}$city_name[$row.cityid]{/yun}{yun:}$city_name[$row.three_cityid]{/yun}'+address.replace(/\s+/g,""));
		{yun:}elseif $row.x!="" && $row.y!=""{/yun}
			setLocation('map_container',{yun:}$row.x{/yun},{yun:}$row.y{/yun},"map_x","map_y");
		{yun:}else{/yun}
			//根据IP到城市开始
			function myFun(result){
				var cityName = result.name;
				map.setCenter(cityName);
			}
			var myCity = new BMap.LocalCity();
			myCity.get(myFun);
			//根据IP到城市结结束
		{yun:}/if{/yun}
     	var worktime='{yun:}$row.workcishu{/yun}';
    	if(worktime==21){
      		$("#ckAll").prop("checked", true);
      		form.render('checkbox'); 
	    }else{
	      	$("#ckAll").prop("checked", false);
	      	form.render('checkbox'); 
	    }
	});
	var local ;
    function localsearch(city){
	    if($("#address").val()!=$("#address").attr('placeholder')){
		    if($("#address").val()==""){
				layer.msg('请输入详细地址！', 2, 8);return false;
			}
			
			map.centerAndZoom(new BMap.Point(116.404, 39.915), 4);
			
			var province = $("#provinceid").find("option:selected").text().replace("请选择", "");	
			var city = $('#cityid').find("option:selected").text().replace("请选择", "");
			var three_city = $('#three_cityid').find("option:selected").text().replace("请选择", "");

			var local = new BMap.LocalSearch(map, {
				renderOptions: {
					map: map
				}
			});
			local.clearResults();
			local.search(province+city+three_city+$("#address").val().replace(/\s+/g,""));
	
		}
    
	}
	function getLocalResult(){
		var address=$.trim($("#address").val());
		var points=local.getResults();
		var lngLat=points.getPoi(0).point;
		setLocation('map_container',lngLat.lng,lngLat.lat,"map_x","map_y");
		document.getElementById("map_x").value=lngLat.lng;
		document.getElementById("map_y").value=lngLat.lat;
	}
	function setLocation(id,x,y,xid,yid){
		var data=get_map_config();
		var config=eval('('+data+')');
		var rating,map_control_type,map_control_anchor;
		if(!x && !y){x=config.map_x;y=config.map_y;}
		var point = new BMap.Point(x,y);
		var marker = new BMap.Marker(point);
		var opts = {type:BMAP_NAVIGATION_CONTROL_LARGE}
		map.enableScrollWheelZoom(true);
		map.addControl(new BMap.NavigationControl(opts));
		map.centerAndZoom(point, 15);
		map.addOverlay(marker);
		map.addEventListener("click",function(e){
		   var info = new BMap.InfoWindow('', {width: 260});
			var projection = this.getMapType().getProjection();
			var lngLat = e.point;
			document.getElementById(xid).value=lngLat.lng;
			document.getElementById(yid).value=lngLat.lat;
			map.clearOverlays();
			var point = new BMap.Point(lngLat.lng,lngLat.lat);
			var marker = new BMap.Marker(point);
			map.addOverlay(marker);
		});
	}
</script> 
<script>
layui.use(['form', 'laydate'], function(){
    var form = layui.form,
		laydate = layui.laydate,
		$ = layui.$,
		url = weburl+"/index.php?m=ajax&c=get_city_option";  

	 //全选  
      form.on('checkbox(ckAll)', function(data){  
        var child = $(data.elem).parents('table').find('tbody input[type="checkbox"]');  
        child.each(function(index, item){  
          item.checked = data.elem.checked;  
        });  
        form.render('checkbox');  
      });  
      form.on('checkbox(partAll)',function(data){
         var item = $(".check_all");
         for (var i = 0; i < item.length; i++) {
        if (item[i].checked == false) {
          $("#ckAll").prop("checked", false);
            form.render('checkbox');
            break;
          }
        } 
        var all=item.length;//选择本页面   全选自动选中
        for (var i = 0; i < item.length; i++) {
          if (item[i].checked == true) {
            all--;
          }
        }
        if(all==0){
          $("#ckAll").prop("checked", true);
          form.render('checkbox');  
        } 
      })	
	form.on('checkbox(timetype)', function(data){
		if(data.elem.checked){
			$("#edate").hide();
			$("#dline").hide();
		}else{
			$("#dline").show();
			$("#edate").show();
		}
	 });
	
	lay('.item_date').each(function(){
		laydate.render({
		  elem: this
		  ,trigger: 'click'
		});
	  });

  });
</script> 

<script src="{yun:}$com_style{/yun}/js/part.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script> 
<script language=javascript src='{yun:}$config.sy_weburl{/yun}/data/plus/city.cache.js?v={yun:}$config.cachecode{/yun}'></script>
<script language=javascript src='{yun:}$config.sy_weburl{/yun}/js/city.js?v={yun:}$config.cachecode{/yun}'></script>
<script src="{yun:}$config.sy_weburl{/yun}/js/ueditor/ueditor.config.js?v={yun:}$config.cachecode{/yun}"></script>
<script src="{yun:}$config.sy_weburl{/yun}/js/ueditor/ueditor.all.min.js?v={yun:}$config.cachecode{/yun}"></script>
<script language="javascript">
	var editor = UE.getEditor('content',{
		toolbars:[[ 'Source','|', 'Undo', 'Redo','Bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'fontfamily', 'fontsize',  'forecolor', 'backcolor', 'removeformat', 'autotypeset', 'pasteplain', '|','insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc', '|','simpleupload', '|', 'indent', '|','justifyleft', 'justifycenter', 'justifyright', 'justifyjustify']],wordCount:false,elementPathEnabled:false,initialFrameHeight:200
	});
</script>
<script>
 	var second = 0;
	window.setInterval(function () {
		second ++;
	}, 1000);

	var url     = location.href, 
		refer   = document.referrer, 
		timeIn  = Math.ceil(new Date().getTime()/1000); 
	{yun:}if $smarty.get.id{/yun}
		var opera=34;//修改兼职
	{yun:}else{/yun}
		var opera=33;//新增兼职
	{yun:}/if{/yun}
	$(function(){//打开页面两秒之后进行行为记录：url,refer,timein,seoncd,opera
		setTimeout(function(){ 
			$.post('index.php?c=log',{url:url,refer:refer,timeIn:timeIn,second:2,opera:opera},function(data){
				if(data){
					$("#logid").val(data);
				}
			})
		},2000);
		
    }) 
	
	window.onbeforeunload = function(){//离开页面操作进行行为数据更新：second，timeout
		var logid = $("#logid").val();
 		if(second>2){ 
			$.post('index.php?c=log&act=gxLog',{id:logid,second:second},function(data){
				if(data) {
					return false;
				}
			})
		}
   	}
</script>
{yun:}include file="$comstyle/footer.htm"{/yun}